var express = require('express');
var router = express.Router();
var { userModel } = require('../db/index')
/* GET home page. */
router.get('/', function (req, res, next) {
  res.render('index', { title: 'Express' });
});
router.get('/data', async (req, res,) => {
  const data = await userModel.find()
  console.log(data);
  res.send({
    status: 200,
    message: "success",
    data

  })
});

module.exports = router;
